﻿/*
 * My Timer - Alarm.cs
 * 
 * Copyright (C) 2009 Ahmad Hanis Azmi
 * 
 * This file is part of My Timer
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

using System.Collections.Generic;

namespace My_Timer
{
    public static class Alarm
    {
        /// <summary>
        /// alarmList - hold the list of time that will trigger the alarm
        /// TKey = int, time in 24 hours format HHmmss for example, 8.51pm will be 205100
        /// </summary>
        public static Dictionary<int, AlarmType> alarmList = new Dictionary<int, AlarmType>();

        /// <summary>
        /// For FormAddEditAlarm.cs
        /// 0 = add, 1 = edit
        /// </summary>
        public static byte addOrEdit;

        /// <summary>
        /// Set AlarmType default value
        /// </summary>
        public static void setAlarmDefaultValue()
        {

        }
    }

    /// <summary>
    /// AlarmType struct
    /// Alarms
    /// </summary>
    public struct AlarmType
    {
        /// <summary>
        /// Alarm title
        /// </summary>
        public string name;

        /// <summary>
        /// Alarm index
        /// </summary>
        public int keyIndex;

        /// <summary>
        /// Alarm time
        /// </summary>
        public AlarmTime alarmTime;

        /// <summary>
        /// Alarm day
        /// </summary>
        public AlarmDay alarmDay;

        /// <summary>
        /// Show message box when alarm end
        /// </summary>
        public MessageBoxAlert messageBox;

        /// <summary>
        /// Play audio when alarm end
        /// </summary>
        public AlarmPlayAudio playAudio;

        /// <summary>
        /// Shutdown when alarm end
        /// 0 - disabled, 1 - shutdown, 2 - restart
        /// </summary>
        public byte shutdownCode;

        /// <summary>
        /// Run/open application when alarm end
        /// </summary>
        public RunApplication runApplication;
    }

    /// <summary>
    /// AlarmTime struct
    /// Store time for alarms
    /// type:
    /// 0 = 24 hours
    /// 1 = AM
    /// 2 = PM
    /// </summary>
    public struct AlarmTime
    {
        public int hours;
        public int minutes;
        public int seconds;
        public byte type;
    }

    /// <summary>
    /// AlarmDay struct
    /// Store the day to activate alarm
    /// </summary>
    public struct AlarmDay
    {
        public bool sunday;
        public bool monday;
        public bool tuesday;
        public bool wednesday;
        public bool thursday;
        public bool friday;
        public bool saturday;
    }

    /// <summary>
    /// MessageBoxAlert struct
    /// </summary>
    public struct MessageBoxAlert
    {
        public bool isEnabled;
        public string message;
    }

    /// <summary>
    /// PlayAudio struct
    /// </summary>
    public struct AlarmPlayAudio
    {
        public bool isEnabled;
        public string audioPath;
    }

    /// <summary>
    /// RunApplication struct
    /// </summary>
    public struct RunApplication
    {
        public bool isEnabled;
        public string runPath;
    }
}